﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CNShapes;

namespace CNStorage
{
    /// <summary>
    /// Holds details of an 'action' that we want to perform on the DB.
    /// This could be a query or an insert. These actions will be created 
    /// by the main thread, and then put on a queue for a background thread
    /// to perform.
    /// </summary>
    internal class QueuedAction
    {
        #region Public properties

        /// <summary>
        /// Gets or sets the SQL statements used by a non-query action.
        /// The action may contain multiple statements.
        /// </summary>
        public IList<string> SQLStatements
        {
            get { return m_SQLStatements; }
        }

        /// <summary>
        /// Gets or sets the Shape used by an update-shape action.
        /// </summary>
        public Shape Shape { get; set; }

        /// <summary>
        /// Gets or sets the Page used by (for example) the load-shapes-asynch action.
        /// </summary>
        public Page Page { get; set; }

        /// <summary>
        /// Gets or sets the PageID.
        /// </summary>
        public Guid PageID { get; set; }

        /// <summary>
        /// Gets or sets the SessionID.
        /// </summary>
        public string SessionID { get; set; }

        #endregion

        #region Private data

        IList<string> m_SQLStatements = new List<string>();

        #endregion
    }
}
